/*
 *  to see the data format in detail , reference the documents below:
 *	pbook: any document about AT command, see CPBR cmmand
 *	pdu:   3GPP2 C.S0015-A  transport layer messages
 *	EFadn: ETS 300 608 (GSM 11.11 version 4.21.1): December 1999
 *	EFsms: 3GPP2 C.S0023-0
 *
 */

#ifndef _RUIM_EF_CODEC_H_
#define _RUIM_EF_CODEC_H_

#ifdef _cplusplus
extern "c" {
#endif

typedef enum _TextCoding
{
	RAW = 1,
	ASCII = 2,
}TextCoding;

typedef struct _PbookInfo
{
	int index;
	unsigned char* number;
	int number_len;
	int number_type;
	unsigned char* text;
	int text_len;        /*number of bytes text has*/
	int coding;          /*ascii or raw mode(we consider it as unicode when encode to EFadn)*/
}PbookInfo;

/*encode pbook struct to EFadn data format*/
int ruim_pbook_encode(const PbookInfo* p_info, unsigned char** efAdnData, int* efAdnDataLen);

int ruim_pbook_decode(const unsigned char* efAdnData, const int efAdnDataLen, PbookInfo* p_info);


/*encode pdu data to EFsms format*/
int ruim_sms_encode(unsigned char status, const unsigned char* pdu, int pdu_len,
		unsigned char** efsms_data, int* efsms_data_len);

int ruim_sms_decode(const unsigned char* efsms_data, int efsms_data_len, 
		unsigned char* status, unsigned char** pdu, int* pdu_len);


#ifdef _cplusplus
}
#endif


#endif
